package com.ewzj.bigdata.mvp.model.rspbean;

import android.os.Parcel;
import android.os.Parcelable;

import com.chad.library.adapter.base.entity.MultiItemEntity;

import java.util.ArrayList;
import java.util.List;

/**
 * author:zhangjing
 * 作用:
 * return:
 */

public class RspOriginBean implements MultiItemEntity, Parcelable {

    /**
     * groupId : 10
     * go_url : http://192.168.0.221:3001/yuanchuang/5
     * is_self : 1
     * is_collect : 0
     * id : 5
     * title : 环京地区楼市交易仍存“潜规则”:加价、捆绑车位售房
     * tags : topic
     * type_id : 1
     * thumb : http://imgs0.soufunimg.com/viewimage/news/2017_04/14/news/1492129279121_000/210x140.jpg
     * sources : 觅窝
     * visit : 0
     * comment : 0
     * create_time : 24小时前
     * topic : [{"groupId":"10","go_url":"http://192.168.0.221:3001/yuanchuang/7","is_self":"1","is_collect":"0","id":"7","title":"武汉成都等5省会城市探索住房公积金自愿缴存 农民工和在校大学生也可参与","tags":"topic","type_id":"1","thumb":"http://imgs1.soufunimg.com/viewimage/news/2017_04/14/news/1492129313485_000/210x140.jpg","sources":"觅窝","visit":"0","comment":"0","create_time":"24小时前","topic":[]},{"groupId":"10","go_url":"http://192.168.0.221:3001/yuanchuang/6","is_self":"1","is_collect":"0","id":"6","title":"二线房企西进瞄准成渝 土地市场上演\u201c抢粮\u201d大战","tags":"topic","type_id":"1","thumb":"http://imgs0.soufunimg.com/viewimage/news/2017_04/14/news/1492129457373_000/210x140.jpg","sources":"觅窝","visit":"0","comment":"0","create_time":"24小时前","topic":[]},{"groupId":"10","go_url":"http://192.168.0.221:3001/yuanchuang/5","is_self":"1","is_collect":"0","id":"5","title":"环京地区楼市交易仍存\u201c潜规则\u201d:加价、捆绑车位售房","tags":"topic","type_id":"1","thumb":"http://imgs0.soufunimg.com/viewimage/news/2017_04/14/news/1492129279121_000/210x140.jpg","sources":"觅窝","visit":"0","comment":"0","create_time":"24小时前","topic":[]}]
     */

    private String groupId;
    private String go_url;
    private int is_self;
    private int is_collect;
    private String id;
    private String title;
    private String tags;
    private int type_id;
    private String thumb;
    private String sources;
    private String visit;
    private String comment;
    private String news_type;
    private String project_name;
    private String topic_sign;
    private String summary;

    private String create_time;
    private List<TopicEntity> topic;

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public String getTopic_sign() {
        return topic_sign;
    }

    public void setTopic_sign(String topic_sign) {
        this.topic_sign = topic_sign;
    }

    public static Creator<RspOriginBean> getCREATOR() {
        return CREATOR;
    }

    public String getProject_name() {
        return project_name;
    }

    public void setProject_name(String project_name) {
        this.project_name = project_name;
    }

    public String getNews_type() {
        return news_type;
    }

    public void setNews_type(String news_type) {
        this.news_type = news_type;
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public String getGo_url() {
        return go_url;
    }

    public void setGo_url(String go_url) {
        this.go_url = go_url;
    }

    public int getIs_self() {
        return is_self;
    }

    public void setIs_self(int is_self) {
        this.is_self = is_self;
    }

    public int getIs_collect() {
        return is_collect;
    }

    public void setIs_collect(int is_collect) {
        this.is_collect = is_collect;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getTags() {
        return tags;
    }

    public void setTags(String tags) {
        this.tags = tags;
    }

    public int getType_id() {
        return type_id;
    }

    public void setType_id(int type_id) {
        this.type_id = type_id;
    }

    public String getThumb() {
        return thumb;
    }

    public void setThumb(String thumb) {
        this.thumb = thumb;
    }

    public String getSources() {
        return sources;
    }

    public void setSources(String sources) {
        this.sources = sources;
    }

    public String getVisit() {
        return visit;
    }

    public void setVisit(String visit) {
        this.visit = visit;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String getCreate_time() {
        return create_time;
    }

    public void setCreate_time(String create_time) {
        this.create_time = create_time;
    }

    public List<TopicEntity> getTopic() {
        return topic;
    }

    public void setTopic(List<TopicEntity> topic) {
        this.topic = topic;
    }

    @Override
    public int getItemType() {
        if (topic!=null&&topic.size()!=0){
            return 0;
        }else {
            return type_id;
        }

    }

    public static class TopicEntity {
        /**
         * groupId : 10
         * go_url : http://192.168.0.221:3001/yuanchuang/7
         * is_self : 1
         * is_collect : 0
         * id : 7
         * title : 武汉成都等5省会城市探索住房公积金自愿缴存 农民工和在校大学生也可参与
         * tags : topic
         * type_id : 1
         * thumb : http://imgs1.soufunimg.com/viewimage/news/2017_04/14/news/1492129313485_000/210x140.jpg
         * sources : 觅窝
         * visit : 0
         * comment : 0
         * create_time : 24小时前
         * topic : []
         */

        private String groupId;
        private String go_url;
        private int is_self;
        private int is_collect;
        private String id;
        private String title;
        private String tags;
        private int type_id;
        private String thumb;
        private String sources;
        private String visit;
        private String comment;
        private String create_time;

        public String getGroupId() {
            return groupId;
        }

        public void setGroupId(String groupId) {
            this.groupId = groupId;
        }

        public String getGo_url() {
            return go_url;
        }

        public void setGo_url(String go_url) {
            this.go_url = go_url;
        }

        public int getIs_self() {
            return is_self;
        }

        public void setIs_self(int is_self) {
            this.is_self = is_self;
        }

        public int getIs_collect() {
            return is_collect;
        }

        public void setIs_collect(int is_collect) {
            this.is_collect = is_collect;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public String getTags() {
            return tags;
        }

        public void setTags(String tags) {
            this.tags = tags;
        }

        public int getType_id() {
            return type_id;
        }

        public void setType_id(int type_id) {
            this.type_id = type_id;
        }

        public String getThumb() {
            return thumb;
        }

        public void setThumb(String thumb) {
            this.thumb = thumb;
        }

        public String getSources() {
            return sources;
        }

        public void setSources(String sources) {
            this.sources = sources;
        }

        public String getVisit() {
            return visit;
        }

        public void setVisit(String visit) {
            this.visit = visit;
        }

        public String getComment() {
            return comment;
        }

        public void setComment(String comment) {
            this.comment = comment;
        }

        public String getCreate_time() {
            return create_time;
        }

        public void setCreate_time(String create_time) {
            this.create_time = create_time;
        }

    }

    public RspOriginBean() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.groupId);
        dest.writeString(this.go_url);
        dest.writeInt(this.is_self);
        dest.writeInt(this.is_collect);
        dest.writeString(this.id);
        dest.writeString(this.title);
        dest.writeString(this.tags);
        dest.writeInt(this.type_id);
        dest.writeString(this.thumb);
        dest.writeString(this.sources);
        dest.writeString(this.visit);
        dest.writeString(this.comment);
        dest.writeString(this.news_type);
        dest.writeString(this.project_name);
        dest.writeString(this.topic_sign);
        dest.writeString(this.summary);
        dest.writeString(this.create_time);
        dest.writeList(this.topic);
    }

    protected RspOriginBean(Parcel in) {
        this.groupId = in.readString();
        this.go_url = in.readString();
        this.is_self = in.readInt();
        this.is_collect = in.readInt();
        this.id = in.readString();
        this.title = in.readString();
        this.tags = in.readString();
        this.type_id = in.readInt();
        this.thumb = in.readString();
        this.sources = in.readString();
        this.visit = in.readString();
        this.comment = in.readString();
        this.news_type = in.readString();
        this.project_name = in.readString();
        this.topic_sign = in.readString();
        this.summary = in.readString();
        this.create_time = in.readString();
        this.topic = new ArrayList<TopicEntity>();
        in.readList(this.topic, TopicEntity.class.getClassLoader());
    }

    public static final Creator<RspOriginBean> CREATOR = new Creator<RspOriginBean>() {
        @Override
        public RspOriginBean createFromParcel(Parcel source) {
            return new RspOriginBean(source);
        }

        @Override
        public RspOriginBean[] newArray(int size) {
            return new RspOriginBean[size];
        }
    };
}
